package model;

import java.io.Serializable;
import javax.persistence.*;
import java.util.List;


/**
 * The persistent class for the formationannee database table.
 * 
 */
@Entity
@NamedQuery(name="Formationannee.findAll", query="SELECT f FROM Formationannee f")
public class Formationannee implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	private int idFormationAnnee;

	private int annee;

	//bi-directional many-to-one association to Candidature
	@OneToMany(mappedBy="formationannee")
	private List<Candidature> candidatures;

	//bi-directional many-to-one association to Enquette
	@OneToMany(mappedBy="formationannee")
	private List<Enquette> enquettes;

	//bi-directional many-to-one association to Formation
	@ManyToOne
	@JoinColumn(name="idFormation")
	private Formation formation;

	//bi-directional many-to-one association to Note
	@OneToMany(mappedBy="formationannee")
	private List<Note> notes;

	//bi-directional many-to-one association to Stage
	@OneToMany(mappedBy="formationannee")
	private List<Stage> stages;

	public Formationannee() {
	}

	public int getIdFormationAnnee() {
		return this.idFormationAnnee;
	}

	public void setIdFormationAnnee(int idFormationAnnee) {
		this.idFormationAnnee = idFormationAnnee;
	}

	public int getAnnee() {
		return this.annee;
	}

	public void setAnnee(int annee) {
		this.annee = annee;
	}

	public List<Candidature> getCandidatures() {
		return this.candidatures;
	}

	public void setCandidatures(List<Candidature> candidatures) {
		this.candidatures = candidatures;
	}

	public Candidature addCandidature(Candidature candidature) {
		getCandidatures().add(candidature);
		candidature.setFormationannee(this);

		return candidature;
	}

	public Candidature removeCandidature(Candidature candidature) {
		getCandidatures().remove(candidature);
		candidature.setFormationannee(null);

		return candidature;
	}

	public List<Enquette> getEnquettes() {
		return this.enquettes;
	}

	public void setEnquettes(List<Enquette> enquettes) {
		this.enquettes = enquettes;
	}

	public Enquette addEnquette(Enquette enquette) {
		getEnquettes().add(enquette);
		enquette.setFormationannee(this);

		return enquette;
	}

	public Enquette removeEnquette(Enquette enquette) {
		getEnquettes().remove(enquette);
		enquette.setFormationannee(null);

		return enquette;
	}

	public Formation getFormation() {
		return this.formation;
	}

	public void setFormation(Formation formation) {
		this.formation = formation;
	}

	public List<Note> getNotes() {
		return this.notes;
	}

	public void setNotes(List<Note> notes) {
		this.notes = notes;
	}

	public Note addNote(Note note) {
		getNotes().add(note);
		note.setFormationannee(this);

		return note;
	}

	public Note removeNote(Note note) {
		getNotes().remove(note);
		note.setFormationannee(null);

		return note;
	}

	public List<Stage> getStages() {
		return this.stages;
	}

	public void setStages(List<Stage> stages) {
		this.stages = stages;
	}

	public Stage addStage(Stage stage) {
		getStages().add(stage);
		stage.setFormationannee(this);

		return stage;
	}

	public Stage removeStage(Stage stage) {
		getStages().remove(stage);
		stage.setFormationannee(null);

		return stage;
	}

}